fix(java): java sdk gaps#362
Merged
Merged
Conversation
Javadoc told readers to place gzip after the signing codec, which decodes to decompress-before-verify — the insecure order.
Production orders priority DESC then scheduled_at ASC; the in-memory backend kept hash-map iteration order on ties.
📝 WalkthroughWalkthroughChanges add a compile-time validation rejecting primitive payload types in ChangesCore behavior changes and tests
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Test as EnqueueDecisionTest
participant Taskito as DefaultTaskito
participant Options as EnqueueOptions
Test->>Taskito: enqueue task (delayMs baked-in) with defer(Duration.ZERO)
Taskito->>Taskito: withDelay clamps delay to 0
Taskito->>Options: rebuild options with delayMs=0
Taskito-->>Test: job scheduled immediately
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the last four medium-severity findings from the Java SDK audit list.
EnqueueDecision.defer(Duration.ZERO)(e.g.deferUntilof a past instant) documents "enqueue now", butwithDelayshort-circuited on non-positive delays and silently kept the task's baked-indelayMs. The delay is now always applied, clamped to non-negative. Regression test asserts a 60s-delay task deferred by zero schedules immediately.GzipCodecafter a signing codec — since codecs decode in reverse, that order decompresses attacker-controlled bytes before verifying integrity. Corrected to match the (already-correct) test and annotation-driven ordering.void handle(int payload)task handler generatednew TypeReference<int>() {}— invalid Java surfacing as a cryptic javac error in the generated companion. The processor now reports a clear diagnostic on the offending method.claimNextpicked an arbitrary job among equal priorities (hash-map iteration order), diverging from production'spriority DESC, scheduled_at ASC. Jobs now carry a monotonic sequence and ties break FIFO. Regression test runs five same-priority jobs on a single-thread worker and asserts enqueue order../gradlew buildgreen across all subprojects.Summary by CodeRabbit
Bug Fixes
Documentation